package com.hanrui.android.activity.message.supervise;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TextView;

import com.hanrui.android.R;
import com.hanrui.android.library.base.ActionBarBaseActivity;
import com.hanrui.android.model.SuperviseMonthDetailBean;
import com.hanrui.android.model.SuperviseWeekDetailBean;
import com.hanrui.android.net.contract.message.supervise.SuperviseDetailContract;
import com.hanrui.android.net.presenter.message.supervise.SuperviseDetailPresenter;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * 月督办详情
 */
public class SuperviseMonthDetailActivity extends ActionBarBaseActivity<SuperviseDetailPresenter> implements SuperviseDetailContract.View {

    @BindView(R.id.main_title)
    TextView mainTitle;
    @BindView(R.id.subhead_title)
    TextView subheadTitle;
    @BindView(R.id.name)
    TextView name;
    @BindView(R.id.time)
    TextView time;
    @BindView(R.id.work_content)
    TextView workContent;
    @BindView(R.id.status)
    TextView status;
    @BindView(R.id.carry)
    TextView carry;
    @BindView(R.id.reson)
    TextView reson;
    @BindView(R.id.carrys)
    TextView carrys;
    @BindView(R.id.resons)
    TextView resons;
    @BindView(R.id.reward)
    TextView reward;
    @BindView(R.id.from)
    TextView from;

    String mid,type;

    @Override
    protected void initInjector() {mActivityComponent.inject(this);}


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_supervisemonthdetail);

        unbinder = ButterKnife.bind(this);

        mid = getIntent().getStringExtra("mid");
        type = getIntent().getStringExtra("type");


        mTitleBar.setTitle("督办详情");


        mPresenter.overSeeMonthDetail(this,mid,type);

    }


    public static void start(Context context,String mid,String type){

        Intent intent = new Intent(context,SuperviseMonthDetailActivity.class);
        intent.putExtra("mid",mid);
        intent.putExtra("type",type);
        context.startActivity(intent);

    }

    @Override
    public void overSeeWeekDetail(SuperviseWeekDetailBean data) { }

    @Override
    public void overSeeMonthDetail(SuperviseMonthDetailBean data) {

        if (null != data) {

            mainTitle.setText(data.getOverseeDetail().getWork());
            subheadTitle.setText(data.getOverseeDetail().getTimeNode());
            name.setText(data.getOverseeDetail().getOfficeAndCompany());
            time.setText(data.getOverseeDetail().getTimeNode());
            workContent.setText(data.getOverseeDetail().getWork());
            status.setText(data.getOverseeDetail().getState());
            carry.setText(data.getOverseeDetail().getImplementation());
            reson.setText(data.getOverseeDetail().getMonthHalfReasons());
            carrys.setText(data.getOverseeDetail().getMonthEndImplementation());
            resons.setText(data.getOverseeDetail().getReasons());
            reward.setText(data.getOverseeDetail().getPenalties());
            from.setText(data.getOverseeDetail().getMeetSource());

        		}

    }
}
